package com.itheima.service.impl.ums;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.mapper.ums.UmsResourceCategoryMapper;
import com.itheima.pojo.ums.UmsResourceCategory;
import com.itheima.service.ums.UmsResourceCategoryService;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.List;

@DubboService
public class UmsResourceCategoryServiceImpl extends ServiceImpl<UmsResourceCategoryMapper,UmsResourceCategory> implements UmsResourceCategoryService {
    /**
     * 添加后台资源分类
     * @param umsResourceCategory
     * @return
     */
    @Override
    public void create(UmsResourceCategory umsResourceCategory) {
        this.save(umsResourceCategory);
    }

    /**
     * 根据ID删除后台资源
     * @param id
     * @return
     */
    @Override
    public void delete(Integer id) {
        this.removeById(id);
    }

    /**
     * 查询所有后台资源分类
     * @return
     */
    @Override
    public List<UmsResourceCategory> listAll() {
        return this.list();
    }

    /**
     * 修改后台资源分类
     * @param umsResourceCategory
     * @return
     */
    @Override
    public boolean updateResource(UmsResourceCategory umsResourceCategory) {
        return  this.updateById(umsResourceCategory);
    }
}
